package com.flavienlaurent.vdh;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

public abstract class BasePagerAdapter<T> extends PagerAdapter {
    private List<T> list = null;

    public BasePagerAdapter(List<T> list) {
        this.list = list;
    }

    public List<T> getList() {
        return list;
    }

    @Override
    public abstract void destroyItem(ViewGroup container, int position, Object object);

    @Override
    public abstract Object instantiateItem(ViewGroup container, int position);

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public boolean isViewFromObject(View arg0, Object arg1) {
        return arg0 == arg1;
    }
}
